package com.woniu.service.Impl;

import com.woniu.dao.CreditContractDao;
import com.woniu.entity.CreContract;
import com.woniu.service.CreditContractService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 2022-9-24 15:43:42
 * 合同
 */
@Service
public class CreditContractServiceImpl implements CreditContractService {

    @Autowired
    CreditContractDao creditContractDao;

    /*
     * 查询合同列表
     * */
    @Override
    public List<CreContract> findAllContract(CreContract creContract) {
        List<CreContract> list = creditContractDao.findAllContract(creContract);
        return list;
    }

    @Override
    public List<CreContract> searchContract(CreContract creContract) {
        List<CreContract> list = creditContractDao.searchContract(creContract);
        return list;
    }

    @Override
    public List<CreContract> selectContractList(Long userId) {
        return null;
    }

    @Override
    public List<CreContract> selectContractList(Integer userId) {
        return creditContractDao.selectCreContractList(userId);
    }

    @Override
    public CreContract selectContractdetail(int orderId) {
        return creditContractDao.selectCreContractdetail(orderId);
    }

    @Override
    public int updateContractStatus(int id) {
        return creditContractDao.updateContractStatus(id);
    }


    /*
     * 合同生成及发送
     * */
    @Override
    public int addContract(CreContract creContract) {
        return creditContractDao.addContract(creContract);
    }

    /**
     * 判断是否有合同超时
     *
     * @return
     */
    @Override
    public int isOutTime() {
        return creditContractDao.isOutTime();
    }

    /**
     * 更新合同状态为已失效
     *
     * @return
     */
    @Override
    public int updateConStatus() {
        return creditContractDao.updateConStatus();
    }

    /**
     * 更新订单状态为已失效
     *
     * @return
     */
    @Override
    public int updateOrdStatus() {
        return creditContractDao.updateOrdStatus();
    }

    @Override
    public int selectOrder(Integer userId) {
        return creditContractDao.selectOrder(userId);
    }


}
